Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(all): multiple warnings fix #2318

Merged
merged 26 commits into from
Feb 10, 2025
Merged

Conversation

TheoPascoli
Copy link
Contributor

@TheoPascoli TheoPascoli commented Jan 27, 2025

Fix multiple warnings and some stuff

@TheoPascoli TheoPascoli marked this pull request as draft January 27, 2025 15:32
@TheoPascoli TheoPascoli force-pushed the fix/remove-some-deprecated-methods branch from 8ecc6b5 to d43d9f9 Compare January 27, 2025 16:07
@TheoPascoli TheoPascoli force-pushed the fix/remove-some-deprecated-methods branch from d43d9f9 to d3c01ea Compare January 28, 2025 10:12
@TheoPascoli TheoPascoli changed the title fix: multiple warnings fix fix(all): multiple warnings fix Jan 28, 2025
@pull-request-size pull-request-size bot added size/L and removed size/M labels Jan 30, 2025
@TheoPascoli TheoPascoli marked this pull request as ready for review January 30, 2025 18:26
antarest/core/filetransfer/service.py Outdated Show resolved Hide resolved
antarest/service_creator.py Outdated Show resolved Hide resolved
@@ -154,8 +154,8 @@ class LinkBaseDTO(AntaresBaseModel):
colorg: int = Field(default=DEFAULT_COLOR, ge=0, le=255)
link_width: float = 1
link_style: LinkStyle = LinkStyle.PLAIN
filter_synthesis: t.Optional[comma_separated_enum_list] = FILTER_VALUES
filter_year_by_year: t.Optional[comma_separated_enum_list] = FILTER_VALUES
filter_synthesis: t.Optional[comma_separated_enum_list] = field(default_factory=lambda: FILTER_VALUES)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it work to use a dataclass field inside a Pydantic class ?

return []

filter_accepted_values = [e for e in enum_cls]
valid_values = {str(e.value) for e in enum_cls}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think you need to do str() as e.value is already one

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need it for mypy


res_json = res.json()
assert res_json["exception"] == "LinkValidationError"
match = re.search(r"Allowed values are: (.*)\.", res_json["description"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test seems a bit complex to me. If you can just check the res_json["description"] in an easier way I won't mind

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, however, the values "daily, hourly, etc" comes in random order at each test, I can not do a simple equal

@TheoPascoli TheoPascoli requested a review from a team February 10, 2025 15:40
@TheoPascoli TheoPascoli merged commit 2a92732 into dev Feb 10, 2025
13 of 14 checks passed
@TheoPascoli TheoPascoli deleted the fix/remove-some-deprecated-methods branch February 10, 2025 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants